<%@page language="java" pageEncoding="utf-8" contentType="text/html; charset=utf-8" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>超市订单管理系统</title>
    <link type="text/css" rel="stylesheet" href="css/style.css"/>
    <link type="text/css" rel="stylesheet" href="css/public.css"/>
</head>
<body>
  <div class="location">
      <strong>你现在所在的位置是:</strong>
      <span>订单管理页面 >> 订单修改页面</span>
  </div>
  <div class="providerAdd">
      <form id="billForm" name="billForm" method="post" action="jsp/bill.do">
          <div class="">
              <label for="idName">订单编码：</label>
              <input type="text" name="idName" id="idName" value="${billInfo.idName }">
          </div>
          <div>
              <label for="name">商品名称：</label>
              <input type="text" name="name" id="name" value="${billInfo.name }">
              <font color="red"></font>
          </div>
          <div>
              <label for="money">总金额：</label>
              <input type="text" name="money" id="money" value="${billInfo.money }">
              <font color="red"></font>
          </div>
          <div>
              <label for="provider">供应商：</label>
               <input type="text" name="provider" id="provider" value="${billInfo.provider }">
              <font color="red"></font>
          </div>
          <div>
              <label>是否付款：</label>
               <select name="state" id="state">
                    <option value="2" <c:if test="${billInfo.state == 2 }">selected</c:if>>未付款</option>
                    <option value="1" <c:if test="${billInfo.state == 1 }">selected</c:if>>已付款</option>
               </select>
          </div>
          <div class="providerAddBtn">
              <input type="button" name="save" id="save" value="保存">
              <input type="button" name="reset" id="reset" value="重置">
              <input type="button" id="back" name="back" value="返回">
          </div>
      </form>
  </div>


<footer class="footer">
    版权归北大青鸟
</footer>

</body>
<!-- 保存当前页的后台路径和参数 -->
<c:set var="urlLoading" value="${pageContext.request.contextPath}/bill/orderDetail" scope="session"></c:set>
<c:set var="paramLoading" value="id=${billInfo.id }&page=orderUpdate.jsp" scope="session"></c:set>

<script type="text/javascript">
$(".providerAddBtn :button[value='保存']").bind("click", function() {
	
	if(!confirm("确定保存吗?")) return;
	
	toJump("${pageContext.request.contextPath}/bill/orderUpdate", 
			$("#billForm").serialize()+"&id=${billInfo.id}", "#mainframe");
});
$(".providerAddBtn :button[value='返回']").bind("click", function() {
	toJump("${pageContext.request.contextPath}/bill/query", 
			"curr=${paBill.curr}", "#mainframe");
});
$(".providerAddBtn :button[value='重置']").bind("click", function() {
	$("#billForm [name='idName']").val("${billInfo.idName}");
	$("#billForm [name='name']").val("${billInfo.name}");
	$("#billForm [name='money']").val("${billInfo.money}");
	$("#billForm [name='provider']").val("${billInfo.provider}");
	$("#billForm [name='state'] option[value='${billInfo.state}']").attr("selected", true);
});
</script>
</html>
